package HUZ_FileIO;

import java.io.*;
import java.util.Scanner;

public class demo6 {
    public static void main(String[] args) throws FileNotFoundException {
//        File file=new File("E:\\Java网络通信程序\\TestDemo1\\file.txt");
//        InputStream inputStream=new FileInputStream(file);
//        BufferedInputStream bufferedInputStream=new BufferedInputStream(inputStream);
//
//        Scanner scanner=new Scanner(file);
//        while(scanner.hasNext()){
//            String ch=scanner.next();
//            System.out.println(ch);
//        }

        InputStream inputStream = new FileInputStream("test.txt");
        //从文件输入流中读取数据
        Scanner scanner=new Scanner(inputStream);
        while(scanner.hasNext()){
            String s=scanner.next();
            System.out.println(s);
        }


    }
}
